class Book:
    def __init__(self, title, author, pub):
        self.title = title
        self.author = author
        self.pub = pub
    def __str__(self):
        # 必须返回一个字符串型数据
        return f'书名：{self.title} 作者：{self.author} 出版社：{self.pub}'
    def __call__(self):
        print('对象调用了...')

# 创建一本图书对象
b1 = Book('Python程序开发', '小东', '清华大学出版社')
print(b1)  # 打印对象
b1()   # 调用对象


